Skip to content

Preview: error codes are always strings - #794

Merged
markdennis22 merged 1 commit into
mainfrom
markdennis/preview-error-code-string
Nov 5, 2026
Merged

markdennis22 merged 1 commit into
mainfrom
markdennis/preview-error-code-string

Conversation

@markdennis22

Copy link
Copy Markdown
Contributor

Why?

On the Preview version, errors[].code is now always a string, but the spec still showed the "Company is not an object" example on POST /companies with the number 422 and allowed a numeric code in the error schema.

How?

Changes that example to "422" and makes the Preview error code a string again; the numbered versions still return the number and are unchanged.

Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@geetikabagga geetikabagga left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve. Preview now matches what the API sends.

  1. Monolith: error_handler.rb:316 renders ApiError status as to_s when RenderValidationErrorCodeAsString is active. That's registered in the UnstableVersion block (service.rb:541) and pinned by the intercom/intercom#604442 companies spec (HTTP 400, "422" on Unstable, 422 on released versions). No integer code: is left in descriptions/0/.
  2. Scope: only descriptions/0/ changes, and 2.17 keeps the anyOf. The 2.18 tracker (intercom/intercom#593318) has this class as Ready with only the OpenAPI and dev-docs gaps, so api-cut-docs should graduate this diff into 2.18. It needs to merge before the 2026-11-06 gap deadline.
  3. intercom/developer-docs#1338: the changed lines are identical to this diff, and the @Preview changelog entry matches.
  4. fern check (5.65.3): 0 errors, 317 warnings, the same as base.

Non-blocking: could you link intercom/intercom#604442 in the body or squash commit, as intercom/developer-docs#1338 does? Then the cut's git log -S trace lands on a commit that names the change.

~ Automated via Claude

@markdennis22
markdennis22 merged commit 1381fe7 into main Nov 5, 2026
4 checks passed
@markdennis22
markdennis22 deleted the markdennis/preview-error-code-string branch November 5, 2026 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants